<?php
declare (strict_types = 1);

namespace app\admin\controller\v1;
use Throwable;
use app\common\Backend;
use app\common\model\Message;

class MessageCon extends Backend
{

    /**
     * @var MessageCon
     */
    protected $tree = null;

    protected $model = null;

    protected $quickSearchField = ['title'];

    public function initialize(): void
    {
        parent::initialize();
        $this->model = new Message();

    }

     /**
     * 数据源
     * @throws Throwable
     */
    public function index(): void
    {
        if ($this->request->param('select')) {
            $this->select();
        }
        list($where, $alias, $limit, $order) = $this->queryBuilder();
        $res = $this->model->where($where)
            ->order($order)
            ->paginate($limit);

        $this->success('', [
            'list'   => $res->items(),
            'total'  => $res->total(),
            'remark' => '',
        ]);
    }



    


}